import {Component, OnInit} from '@angular/core';
import {NavigationEnd, Router} from '@angular/router';
import {TranslateService} from '@ngx-translate/core';
import {APPCONFIG} from './appconfig';

@Component({
    selector: 'app-root',
    templateUrl: './app.component.html',
    styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit {
    public AppConfig: any;
    title = 'app';
    constructor(private router: Router,
                private translate: TranslateService) {
        translate.setDefaultLang('zh');
    }

    ngOnInit() {
        this.AppConfig = APPCONFIG;
        this.router.events.subscribe((evt) => {
            if (!(evt instanceof NavigationEnd)) {
                return;
            }
            document.body.scrollTop = 0;
        });
    }

}
